home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
C64
/
U-Utilities
/
(c)u2.d64
/
dir read.c
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2007-02-04
|
2KB
|
50 lines
100 REM: C64 DIRECTORY READER
110 REM: USES FASTGET ROUTINE
120 REM: PAUL BLAIR
130 REM: CANBERRA AUSTRALIA
140 REM: 4 JAN 1984
150 :
160 IFPEEK(52850)=169THEN180 :REM:CHECK M/C IN PLACE
170 LOAD"DIR READ ML.D",8,1:RUN :REM:OTHERWISE LOAD IT
180 K=53280:POKEK,1:POKEK+1,1:DIMF$(144):NL$=CHR$(0):Q$=CHR$(34)
190 BL$=" ":PRINT"[147] DIRECTORY SUBROUTINE.. PAUL BLAIR"
200 OPEN15,8,15:PRINT#15,"I0" :REM:SET UP ERROR CH
210 OPEN1,8,0,"$0":POKE52817,1 :REM:USING CHANNEL 1
220 POKE52816,32:SYS52850 :REM:GET HEADER
230 MD$=MID$(IP$,5):PRINTMD$" [151]" :REM:DISK HEADER
240 VZ$=MID$(MD$,23,2):MD$=VZ$+MID$(MD$,5,16)
250 SYS52850:AQ$=IP$ :REM:INPUT IS IN IP$ EACH TIME
260 IFSTTHEN400: :REM:CHECK FILE STATUS
270 AQ$=LEFT$(AQ$,LEN(AQ$)-1) :REM:TRIM IT UP
280 BL=ASC(MID$(AQ$,3,1)+NL$)+ASC(MID$(AQ$,4,1)+NL$)*256
290 BK$=RIGHT$(" "+STR$(BL),3) :REM:BLOCKS/DIR. ENTRY
300 F$=MID$(AQ$,11-LEN(STR$(BL)),17) :REM:HUNT THE QUOTES
310 FORI=17TO1STEP-1:IFMID$(F$,I,1)=Q$THENJ=I:I=0
320 NEXT
330 IFNOTITHENCLOSE15:END :REM:ERROR
340 IFRIGHT$(AQ$,1)=" "THENAQ$=LEFT$(AQ$,LEN(AQ$)-1):GOTO340
350 F$=LEFT$(F$,J-1):PT$="" :REM:QUOTELESS TITLE
360 FORT=3TO1STEP-1:PT$=PT$+CHR$(ASC(RIGHT$(AQ$,T))):NEXT
370 Q=Q+1:F$(Q)=VZ$+PT$+BK$+F$ :REM:TO MAKE COMPRESSED ARRAY
380 PRINTBK$" "LEFT$(F$+BL$,17)PT$" "VZ$:REM:SHOW DIRECTORY ENTRY
390 GOTO250: :REM:MORETO DO
400 BF$=RIGHT$(" "+STR$(ASC(MID$(AQ$,3)+NL$)+ASC(MID$(AQ$,4)+NL$)*256),4)
410 CLOSE1:CLOSE15:PRINT"FREE BLOCKS ="BF$
420 PRINT" PRESS ANY KEY TO CONTINUE "
430 GETY$:IFY$=""THEN430
440 PRINT" THE PROGRAM MAKES UP A COMPRESSED"
450 PRINT" LIST THAT LOOKS LIKE THIS:-[149]"
460 FORDL=1TO2000:NEXT
470 FORK=1TOQ:PRINTF$(K):NEXT
480 PRINT"[145]"F$(K-1)"[146]_ENTRY LENGTH[149]":PRINT
490 PRINT"^ ^ ^^":PRINT"[221] [221] [221][173] PROGRAM NAME[149]"
500 PRINT"[221] [221] [173][192] BLOCKS USED[149]"
510 PRINT"[221] [173][192][192][192][192][192][192] FILE TYPE[149]"
520 PRINT"[173][192][192][192][192][192][192][192][192] DISK ID"
530 PRINT:PRINT"[144] THIS SEGMENT COULD BE USED FOR ANY"
540 PRINT" PROGRAM THAT REQUIRES ACCESS TO"
550 PRINT" DETAILS CONTAINED IN THE DIRECTORY"
560 PRINT:PRINT" LEAVE OUT THE PARTS YOU DON'T WANT"
570 PRINT" - IT WILL SPEED UP THE PROGRAM"
580 PRINT:PRINT" HAVE FUN!!"